<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This file documents the use of the GNU compilers.

Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Darwin Options (Using the GNU Compiler Collection (GCC))</title>

<meta name="description" content="Darwin Options (Using the GNU Compiler Collection (GCC))">
<meta name="keywords" content="Darwin Options (Using the GNU Compiler Collection (GCC))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Indices.html" rel="index" title="Indices">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Submodel-Options.html" rel="up" title="Submodel Options">
<link href="DEC-Alpha-Options.html" rel="next" title="DEC Alpha Options">
<link href="C_002dSKY-Options.html" rel="prev" title="C-SKY Options">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
kbd.key {font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en_US">
<div class="subsection-level-extent" id="Darwin-Options">
<div class="nav-panel">
<p>
Next: <a href="DEC-Alpha-Options.html" accesskey="n" rel="next">DEC Alpha Options</a>, Previous: <a href="C_002dSKY-Options.html" accesskey="p" rel="prev">C-SKY Options</a>, Up: <a href="Submodel-Options.html" accesskey="u" rel="up">Machine-Dependent Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Darwin-Options-1"><span>3.19.11 Darwin Options<a class="copiable-link" href="#Darwin-Options-1"> &para;</a></span></h4>
<a class="index-entry-id" id="index-Darwin-options"></a>

<p>These options are defined for all architectures running the Darwin operating
system.
</p>
<p>FSF GCC on Darwin does not create &ldquo;fat&rdquo; object files; it creates
an object file for the single architecture that GCC was built to
target.  Apple&rsquo;s GCC on Darwin does create &ldquo;fat&rdquo; files if multiple
<samp class="option">-arch</samp> options are used; it does so by running the compiler or
linker multiple times and joining the results together with
<samp class="file">lipo</samp>.
</p>
<p>The subtype of the file created (like &lsquo;<samp class="samp">ppc7400</samp>&rsquo; or &lsquo;<samp class="samp">ppc970</samp>&rsquo; or
&lsquo;<samp class="samp">i686</samp>&rsquo;) is determined by the flags that specify the ISA
that GCC is targeting, like <samp class="option">-mcpu</samp> or <samp class="option">-march</samp>.  The
<samp class="option">-force_cpusubtype_ALL</samp> option can be used to override this.
</p>
<p>The Darwin tools vary in their behavior when presented with an ISA
mismatch.  The assembler, <samp class="file">as</samp>, only permits instructions to
be used that are valid for the subtype of the file it is generating,
so you cannot put 64-bit instructions in a &lsquo;<samp class="samp">ppc750</samp>&rsquo; object file.
The linker for shared libraries, <samp class="file">/usr/bin/libtool</samp>, fails
and prints an error if asked to create a shared library with a less
restrictive subtype than its input files (for instance, trying to put
a &lsquo;<samp class="samp">ppc970</samp>&rsquo; object file in a &lsquo;<samp class="samp">ppc7400</samp>&rsquo; library).  The linker
for executables, <code class="command">ld</code>, quietly gives the executable the most
restrictive subtype of any of its input files.
</p>
<dl class="table">
<dt><a id="index-F"></a><span><code class="code">-F<var class="var">dir</var></code><a class="copiable-link" href="#index-F"> &para;</a></span></dt>
<dd><p>Add the framework directory <var class="var">dir</var> to the head of the list of
directories to be searched for header files.  These directories are
interleaved with those specified by <samp class="option">-I</samp> options and are
scanned in a left-to-right order.
</p>
<p>A framework directory is a directory with frameworks in it.  A
framework is a directory with a <samp class="file">Headers</samp> and/or
<samp class="file">PrivateHeaders</samp> directory contained directly in it that ends
in <samp class="file">.framework</samp>.  The name of a framework is the name of this
directory excluding the <samp class="file">.framework</samp>.  Headers associated with
the framework are found in one of those two directories, with
<samp class="file">Headers</samp> being searched first.  A subframework is a framework
directory that is in a framework&rsquo;s <samp class="file">Frameworks</samp> directory.
Includes of subframework headers can only appear in a header of a
framework that contains the subframework, or in a sibling subframework
header.  Two subframeworks are siblings if they occur in the same
framework.  A subframework should not have the same name as a
framework; a warning is issued if this is violated.  Currently a
subframework cannot have subframeworks; in the future, the mechanism
may be extended to support this.  The standard frameworks can be found
in <samp class="file">/System/Library/Frameworks</samp> and
<samp class="file">/Library/Frameworks</samp>.  An example include looks like
<code class="code">#include &lt;Framework/header.h&gt;</code>, where <samp class="file">Framework</samp> denotes
the name of the framework and <samp class="file">header.h</samp> is found in the
<samp class="file">PrivateHeaders</samp> or <samp class="file">Headers</samp> directory.
</p>
</dd>
<dt><a id="index-iframework"></a><span><code class="code">-iframework<var class="var">dir</var></code><a class="copiable-link" href="#index-iframework"> &para;</a></span></dt>
<dd><p>Like <samp class="option">-F</samp> except the directory is a treated as a system
directory.  The main difference between this <samp class="option">-iframework</samp> and
<samp class="option">-F</samp> is that with <samp class="option">-iframework</samp> the compiler does not
warn about constructs contained within header files found via
<var class="var">dir</var>.  This option is valid only for the C family of languages.
</p>
</dd>
<dt><a id="index-gused"></a><span><code class="code">-gused</code><a class="copiable-link" href="#index-gused"> &para;</a></span></dt>
<dd><p>Emit debugging information for symbols that are used.  For stabs
debugging format, this enables <samp class="option">-feliminate-unused-debug-symbols</samp>.
This is by default ON.
</p>
</dd>
<dt><a id="index-gfull"></a><span><code class="code">-gfull</code><a class="copiable-link" href="#index-gfull"> &para;</a></span></dt>
<dd><p>Emit debugging information for all symbols and types.
</p>
</dd>
<dt><a id="index-fconstant_002dcfstrings"></a><span><code class="code">-fconstant-cfstrings</code><a class="copiable-link" href="#index-fconstant_002dcfstrings"> &para;</a></span></dt>
<dd><p>The <samp class="option">-fconstant-cfstrings</samp> is an alias for <samp class="option">-mconstant-cfstrings</samp>.
</p>
</dd>
<dt><a id="index-mconstant_002dcfstrings"></a><span><code class="code">-mconstant-cfstrings</code><a class="copiable-link" href="#index-mconstant_002dcfstrings"> &para;</a></span></dt>
<dd><p>When the NeXT runtime is being used (the default on these systems), override
any <samp class="option">-fconstant-string-class</samp> setting and cause <code class="code">@&quot;&hellip;&quot;</code>
literals to be laid out as constant CoreFoundation strings.
</p>
</dd>
<dt><a id="index-mmacosx_002dversion_002dmin"></a><span><code class="code">-mmacosx-version-min=<var class="var">version</var></code><a class="copiable-link" href="#index-mmacosx_002dversion_002dmin"> &para;</a></span></dt>
<dd><p>The earliest version of MacOS X that this executable will run on is
<var class="var">version</var>.  Typical values supported for <var class="var">version</var> include <code class="code">12</code>,
<code class="code">10.12</code>, and <code class="code">10.5.8</code>.
</p>
<p>If the compiler was built to use the system&rsquo;s headers by default,
then the default for this option is the system version on which the
compiler is running, otherwise the default is to make choices that
are compatible with as many systems and code bases as possible.
</p>
</dd>
<dt><a id="index-mkernel"></a><span><code class="code">-mkernel</code><a class="copiable-link" href="#index-mkernel"> &para;</a></span></dt>
<dd><p>Enable kernel development mode.  The <samp class="option">-mkernel</samp> option sets
<samp class="option">-static</samp>, <samp class="option">-fno-common</samp>, <samp class="option">-fno-use-cxa-atexit</samp>,
<samp class="option">-fno-exceptions</samp>, <samp class="option">-fno-non-call-exceptions</samp>,
<samp class="option">-fapple-kext</samp>, <samp class="option">-fno-weak</samp> and <samp class="option">-fno-rtti</samp> where
applicable.  This mode also sets <samp class="option">-mno-altivec</samp>,
<samp class="option">-msoft-float</samp>, <samp class="option">-fno-builtin</samp> and
<samp class="option">-mlong-branch</samp> for PowerPC targets.
</p>
</dd>
<dt><a id="index-mone_002dbyte_002dbool"></a><span><code class="code">-mone-byte-bool</code><a class="copiable-link" href="#index-mone_002dbyte_002dbool"> &para;</a></span></dt>
<dd><p>Override the defaults for <code class="code">bool</code> so that <code class="code">sizeof(bool)==1</code>.
By default <code class="code">sizeof(bool)</code> is <code class="code">4</code> when compiling for
Darwin/PowerPC and <code class="code">1</code> when compiling for Darwin/x86, so this
option has no effect on x86.
</p>
<p><strong class="strong">Warning:</strong> The <samp class="option">-mone-byte-bool</samp> switch causes GCC
to generate code that is not binary compatible with code generated
without that switch.  Using this switch may require recompiling all
other modules in a program, including system libraries.  Use this
switch to conform to a non-default data model.
</p>
</dd>
<dt><a class="index-entry-id" id="index-ffix_002dand_002dcontinue"></a>
<a class="index-entry-id" id="index-findirect_002ddata"></a>
<a id="index-mfix_002dand_002dcontinue"></a><span><code class="code">-mfix-and-continue</code><a class="copiable-link" href="#index-mfix_002dand_002dcontinue"> &para;</a></span></dt>
<dt><code class="code">-ffix-and-continue</code></dt>
<dt><code class="code">-findirect-data</code></dt>
<dd><p>Generate code suitable for fast turnaround development, such as to
allow GDB to dynamically load <samp class="file">.o</samp> files into already-running
programs.  <samp class="option">-findirect-data</samp> and <samp class="option">-ffix-and-continue</samp>
are provided for backwards compatibility.
</p>
</dd>
<dt><a id="index-all_005fload"></a><span><code class="code">-all_load</code><a class="copiable-link" href="#index-all_005fload"> &para;</a></span></dt>
<dd><p>Loads all members of static archive libraries.
See man ld(1) for more information.
</p>
</dd>
<dt><a id="index-arch_005ferrors_005ffatal"></a><span><code class="code">-arch_errors_fatal</code><a class="copiable-link" href="#index-arch_005ferrors_005ffatal"> &para;</a></span></dt>
<dd><p>Cause the errors having to do with files that have the wrong architecture
to be fatal.
</p>
</dd>
<dt><a id="index-bind_005fat_005fload"></a><span><code class="code">-bind_at_load</code><a class="copiable-link" href="#index-bind_005fat_005fload"> &para;</a></span></dt>
<dd><p>Causes the output file to be marked such that the dynamic linker will
bind all undefined references when the file is loaded or launched.
</p>
</dd>
<dt><a id="index-bundle"></a><span><code class="code">-bundle</code><a class="copiable-link" href="#index-bundle"> &para;</a></span></dt>
<dd><p>Produce a Mach-o bundle format file.
See man ld(1) for more information.
</p>
</dd>
<dt><a id="index-bundle_005floader"></a><span><code class="code">-bundle_loader <var class="var">executable</var></code><a class="copiable-link" href="#index-bundle_005floader"> &para;</a></span></dt>
<dd><p>This option specifies the <var class="var">executable</var> that will load the build
output file being linked.  See man ld(1) for more information.
</p>
</dd>
<dt><a id="index-dynamiclib"></a><span><code class="code">-dynamiclib</code><a class="copiable-link" href="#index-dynamiclib"> &para;</a></span></dt>
<dd><p>When passed this option, GCC produces a dynamic library instead of
an executable when linking, using the Darwin <samp class="file">libtool</samp> command.
</p>
</dd>
<dt><a id="index-force_005fcpusubtype_005fALL"></a><span><code class="code">-force_cpusubtype_ALL</code><a class="copiable-link" href="#index-force_005fcpusubtype_005fALL"> &para;</a></span></dt>
<dd><p>This causes GCC&rsquo;s output file to have the &lsquo;<samp class="samp">ALL</samp>&rsquo; subtype, instead of
one controlled by the <samp class="option">-mcpu</samp> or <samp class="option">-march</samp> option.
</p>
</dd>
<dt><a id="index-allowable_005fclient"></a><span><code class="code">-allowable_client  <var class="var">client_name</var></code><a class="copiable-link" href="#index-allowable_005fclient"> &para;</a></span></dt>
<dt><code class="code">-client_name</code></dt>
<dt><code class="code">-compatibility_version</code></dt>
<dt><code class="code">-current_version</code></dt>
<dt><code class="code">-dead_strip</code></dt>
<dt><code class="code">-dependency-file</code></dt>
<dt><code class="code">-dylib_file</code></dt>
<dt><code class="code">-dylinker_install_name</code></dt>
<dt><code class="code">-dynamic</code></dt>
<dt><code class="code">-exported_symbols_list</code></dt>
<dt><code class="code">-filelist</code></dt>
<dt><code class="code">-flat_namespace</code></dt>
<dt><code class="code">-force_flat_namespace</code></dt>
<dt><code class="code">-headerpad_max_install_names</code></dt>
<dt><code class="code">-image_base</code></dt>
<dt><code class="code">-init</code></dt>
<dt><code class="code">-install_name</code></dt>
<dt><code class="code">-keep_private_externs</code></dt>
<dt><code class="code">-multi_module</code></dt>
<dt><code class="code">-multiply_defined</code></dt>
<dt><code class="code">-multiply_defined_unused</code></dt>
<dt><code class="code">-noall_load</code></dt>
<dt><code class="code">-no_dead_strip_inits_and_terms</code></dt>
<dt><code class="code">-nofixprebinding</code></dt>
<dt><code class="code">-nomultidefs</code></dt>
<dt><code class="code">-noprebind</code></dt>
<dt><code class="code">-noseglinkedit</code></dt>
<dt><code class="code">-pagezero_size</code></dt>
<dt><code class="code">-prebind</code></dt>
<dt><code class="code">-prebind_all_twolevel_modules</code></dt>
<dt><code class="code">-private_bundle</code></dt>
<dt><code class="code">-read_only_relocs</code></dt>
<dt><code class="code">-sectalign</code></dt>
<dt><code class="code">-sectobjectsymbols</code></dt>
<dt><code class="code">-whyload</code></dt>
<dt><code class="code">-seg1addr</code></dt>
<dt><code class="code">-sectcreate</code></dt>
<dt><code class="code">-sectobjectsymbols</code></dt>
<dt><code class="code">-sectorder</code></dt>
<dt><code class="code">-segaddr</code></dt>
<dt><code class="code">-segs_read_only_addr</code></dt>
<dt><code class="code">-segs_read_write_addr</code></dt>
<dt><code class="code">-seg_addr_table</code></dt>
<dt><code class="code">-seg_addr_table_filename</code></dt>
<dt><code class="code">-seglinkedit</code></dt>
<dt><code class="code">-segprot</code></dt>
<dt><code class="code">-segs_read_only_addr</code></dt>
<dt><code class="code">-segs_read_write_addr</code></dt>
<dt><code class="code">-single_module</code></dt>
<dt><code class="code">-static</code></dt>
<dt><code class="code">-sub_library</code></dt>
<a class="index-entry-id" id="index-client_005fname"></a>
<a class="index-entry-id" id="index-compatibility_005fversion"></a>
<a class="index-entry-id" id="index-current_005fversion"></a>
<a class="index-entry-id" id="index-dead_005fstrip"></a>
<a class="index-entry-id" id="index-dependency_002dfile"></a>
<a class="index-entry-id" id="index-dylib_005ffile"></a>
<a class="index-entry-id" id="index-dylinker_005finstall_005fname"></a>
<a class="index-entry-id" id="index-dynamic"></a>
<a class="index-entry-id" id="index-exported_005fsymbols_005flist"></a>
<a class="index-entry-id" id="index-filelist"></a>
<a class="index-entry-id" id="index-flat_005fnamespace"></a>
<a class="index-entry-id" id="index-force_005fflat_005fnamespace"></a>
<a class="index-entry-id" id="index-headerpad_005fmax_005finstall_005fnames"></a>
<a class="index-entry-id" id="index-image_005fbase"></a>
<a class="index-entry-id" id="index-init"></a>
<a class="index-entry-id" id="index-install_005fname"></a>
<a class="index-entry-id" id="index-keep_005fprivate_005fexterns"></a>
<a class="index-entry-id" id="index-multi_005fmodule"></a>
<a class="index-entry-id" id="index-multiply_005fdefined"></a>
<a class="index-entry-id" id="index-multiply_005fdefined_005funused"></a>
<a class="index-entry-id" id="index-noall_005fload"></a>
<a class="index-entry-id" id="index-no_005fdead_005fstrip_005finits_005fand_005fterms"></a>
<a class="index-entry-id" id="index-nofixprebinding"></a>
<a class="index-entry-id" id="index-nomultidefs"></a>
<a class="index-entry-id" id="index-noprebind"></a>
<a class="index-entry-id" id="index-noseglinkedit"></a>
<a class="index-entry-id" id="index-pagezero_005fsize"></a>
<a class="index-entry-id" id="index-prebind"></a>
<a class="index-entry-id" id="index-prebind_005fall_005ftwolevel_005fmodules"></a>
<a class="index-entry-id" id="index-private_005fbundle"></a>
<a class="index-entry-id" id="index-read_005fonly_005frelocs"></a>
<a class="index-entry-id" id="index-sectalign"></a>
<a class="index-entry-id" id="index-sectobjectsymbols"></a>
<a class="index-entry-id" id="index-whyload"></a>
<a class="index-entry-id" id="index-seg1addr"></a>
<a class="index-entry-id" id="index-sectcreate"></a>
<a class="index-entry-id" id="index-sectobjectsymbols-1"></a>
<a class="index-entry-id" id="index-sectorder"></a>
<a class="index-entry-id" id="index-segaddr"></a>
<a class="index-entry-id" id="index-segs_005fread_005fonly_005faddr"></a>
<a class="index-entry-id" id="index-segs_005fread_005fwrite_005faddr"></a>
<a class="index-entry-id" id="index-seg_005faddr_005ftable"></a>
<a class="index-entry-id" id="index-seg_005faddr_005ftable_005ffilename"></a>
<a class="index-entry-id" id="index-seglinkedit"></a>
<a class="index-entry-id" id="index-segprot"></a>
<a class="index-entry-id" id="index-segs_005fread_005fonly_005faddr-1"></a>
<a class="index-entry-id" id="index-segs_005fread_005fwrite_005faddr-1"></a>
<a class="index-entry-id" id="index-single_005fmodule"></a>
<a class="index-entry-id" id="index-static-1"></a>
<a class="index-entry-id" id="index-sub_005flibrary"></a>
<a class="index-entry-id" id="index-sub_005fumbrella"></a>
<a class="index-entry-id" id="index-twolevel_005fnamespace"></a>
<a class="index-entry-id" id="index-umbrella"></a>
<a class="index-entry-id" id="index-undefined"></a>
<a class="index-entry-id" id="index-unexported_005fsymbols_005flist"></a>
<a class="index-entry-id" id="index-weak_005freference_005fmismatches"></a>
<a class="index-entry-id" id="index-whatsloaded"></a>
<dt><code class="code">-sub_umbrella</code></dt>
<dt><code class="code">-twolevel_namespace</code></dt>
<dt><code class="code">-umbrella</code></dt>
<dt><code class="code">-undefined</code></dt>
<dt><code class="code">-unexported_symbols_list</code></dt>
<dt><code class="code">-weak_reference_mismatches</code></dt>
<dt><code class="code">-whatsloaded</code></dt>
<dd><p>These options are passed to the Darwin linker.  The Darwin linker man page
describes them in detail.
</p></dd>
</dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="DEC-Alpha-Options.html">DEC Alpha Options</a>, Previous: <a href="C_002dSKY-Options.html">C-SKY Options</a>, Up: <a href="Submodel-Options.html">Machine-Dependent Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indices.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
